#include <stdio.h>
#include <sys/inotify.h>

int main(int argc, char *argv[])
{
    char *path = argv[1];

    int fd = inotify_init();
    if (fd < 0) {
        printf("failed to init inotify!\n");
        return -1;
    }

    int wd = inotify_add_watch(fd, path, IN_ALL_EVENTS);
    if (wd < 0) {
        printf("failed to add watch!\n");
        return -1;
    }

    return 0;
}
